@echo Deploying SharePointPowerToys.PowerQueryWebPart
IF [%1]==[] (
  set APPURL=http://powertoys.extranet
) else (
  set APPURL=%1
)
@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%

stsadm -o deactivatefeature -name SharePointPowerToys.PowerQueryWebPart -force -url %APPURL%

stsadm -o retractsolution -name SharePointPowerToys.PowerQueryWebPart.wsp -immediate -allcontenturls
stsadm -o execadmsvcjobs
pause
stsadm -o deletesolution -name SharePointPowerToys.PowerQueryWebPart.wsp -override
stsadm -o execadmsvcjobs
pause
stsadm -o addsolution -filename SharePointPowerToys.PowerQueryWebPart.wsp 
stsadm -o execadmsvcjobs
pause
stsadm -o deploysolution -name SharePointPowerToys.PowerQueryWebPart.wsp -immediate -allowGacDeployment -allContentUrls
stsadm -o execadmsvcjobs

IF [%2]==[-activate] (
  stsadm -o activatefeature -name SharePointPowerToys.PowerQueryWebPart -url %APPURL%
)
